/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.ufrpe.bsi.pvs.view.assistant;

import java.awt.Color;

import javax.swing.JLabel;

import br.ufrpe.bsi.pvs.model.roupa.TipoCorporeo;
import br.ufrpe.bsi.pvs.view.PvsFrame;

public class TelaTipoCorporeo extends javax.swing.JPanel {

    public static TelaTipoCorporeo INSTANCE = new TelaTipoCorporeo();
    
    /**
     * Creates new form TelaTipoCorporeo
     */
    private TelaTipoCorporeo() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        lbAmpulheta = new javax.swing.JLabel();
        lbOval = new javax.swing.JLabel();
        lbRetangulo = new javax.swing.JLabel();
        lbPera = new javax.swing.JLabel();
        lbInvertido = new javax.swing.JLabel();
        lbStatus = new javax.swing.JLabel();

        setBackground(java.awt.Color.white);

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/back.png"))); // NOI18N
        jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel1MouseClicked(evt);
            }
        });

        jLabel3.setBackground(java.awt.Color.white);
        jLabel3.setFont(new java.awt.Font("Gabriola", 0, 36)); // NOI18N
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("Selecione seu Gênero");
        jLabel3.setToolTipText("");

        jPanel1.setOpaque(false);
        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 30, 30));

        lbAmpulheta.setBackground(java.awt.Color.white);
        lbAmpulheta.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbAmpulheta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ampulheta.png"))); // NOI18N
        lbAmpulheta.setMaximumSize(new java.awt.Dimension(180, 400));
        lbAmpulheta.setOpaque(true);
        lbAmpulheta.setPreferredSize(new java.awt.Dimension(200, 400));
        lbAmpulheta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbAmpulhetaMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbAmpulhetaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbAmpulhetaMouseExited(evt);
            }
        });
        jPanel1.add(lbAmpulheta);

        lbOval.setBackground(java.awt.Color.white);
        lbOval.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbOval.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/oval.png"))); // NOI18N
        lbOval.setMaximumSize(new java.awt.Dimension(180, 400));
        lbOval.setOpaque(true);
        lbOval.setPreferredSize(new java.awt.Dimension(200, 400));
        lbOval.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOvalMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbOvalMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbOvalMouseExited(evt);
            }
        });
        jPanel1.add(lbOval);

        lbRetangulo.setBackground(java.awt.Color.white);
        lbRetangulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbRetangulo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/retangulo.png"))); // NOI18N
        lbRetangulo.setMaximumSize(new java.awt.Dimension(180, 400));
        lbRetangulo.setOpaque(true);
        lbRetangulo.setPreferredSize(new java.awt.Dimension(200, 400));
        lbRetangulo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbRetanguloMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbRetanguloMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbRetanguloMouseExited(evt);
            }
        });
        jPanel1.add(lbRetangulo);

        lbPera.setBackground(java.awt.Color.white);
        lbPera.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbPera.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pera.png"))); // NOI18N
        lbPera.setMaximumSize(new java.awt.Dimension(180, 400));
        lbPera.setOpaque(true);
        lbPera.setPreferredSize(new java.awt.Dimension(200, 400));
        lbPera.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbPeraMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbPeraMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbPeraMouseExited(evt);
            }
        });
        jPanel1.add(lbPera);

        lbInvertido.setBackground(java.awt.Color.white);
        lbInvertido.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbInvertido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/triangulo-invertido.png"))); // NOI18N
        lbInvertido.setMaximumSize(new java.awt.Dimension(180, 400));
        lbInvertido.setOpaque(true);
        lbInvertido.setPreferredSize(new java.awt.Dimension(200, 400));
        lbInvertido.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbInvertidoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbInvertidoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbInvertidoMouseExited(evt);
            }
        });
        jPanel1.add(lbInvertido);

        lbStatus.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N
        lbStatus.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 1155, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 1110, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbStatus, javax.swing.GroupLayout.DEFAULT_SIZE, 10, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked
        PvsFrame.INSTANCE.home();
    }//GEN-LAST:event_jLabel1MouseClicked

    private void lbAmpulhetaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbAmpulhetaMouseClicked
        Query.getInstance().setTipoc(TipoCorporeo.AMPULHETA);
        PvsFrame.INSTANCE.home();
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbAmpulhetaMouseClicked

    private void lbAmpulhetaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbAmpulhetaMouseEntered
        mouseEnterBorder((JLabel) evt.getSource(), "Ampulheta");
    }//GEN-LAST:event_lbAmpulhetaMouseEntered

    private void lbAmpulhetaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbAmpulhetaMouseExited
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbAmpulhetaMouseExited

    private void lbOvalMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOvalMouseClicked
        Query.getInstance().setTipoc(TipoCorporeo.OVAL);
        PvsFrame.INSTANCE.home();
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbOvalMouseClicked

    private void lbOvalMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOvalMouseEntered
        mouseEnterBorder((JLabel) evt.getSource(), "Oval");
    }//GEN-LAST:event_lbOvalMouseEntered

    private void lbOvalMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOvalMouseExited
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbOvalMouseExited

    private void lbRetanguloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbRetanguloMouseClicked
        Query.getInstance().setTipoc(TipoCorporeo.RETANGULO);
        PvsFrame.INSTANCE.home();
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbRetanguloMouseClicked

    private void lbRetanguloMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbRetanguloMouseEntered
        mouseEnterBorder((JLabel) evt.getSource(), "Retangulo");
    }//GEN-LAST:event_lbRetanguloMouseEntered

    private void lbRetanguloMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbRetanguloMouseExited
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbRetanguloMouseExited

    private void lbPeraMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPeraMouseClicked
        Query.getInstance().setTipoc(TipoCorporeo.PERA);
        PvsFrame.INSTANCE.home();
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbPeraMouseClicked

    private void lbPeraMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPeraMouseEntered
        mouseEnterBorder((JLabel) evt.getSource(), "Pera");
    }//GEN-LAST:event_lbPeraMouseEntered

    private void lbPeraMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPeraMouseExited
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbPeraMouseExited

    private void lbInvertidoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbInvertidoMouseExited
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbInvertidoMouseExited

    private void lbInvertidoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbInvertidoMouseEntered
        mouseEnterBorder((JLabel) evt.getSource(), "Triangulo Invertido");
    }//GEN-LAST:event_lbInvertidoMouseEntered

    private void lbInvertidoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbInvertidoMouseClicked
        Query.getInstance().setTipoc(TipoCorporeo.TRIANGULO_INVERTIDO);
        PvsFrame.INSTANCE.home();
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lbInvertidoMouseClicked

    public void mouseEnterBorder(JLabel icon, String message) {
        icon.setBackground(new Color(245, 245, 245));
        lbStatus.setText(message);
    }

    public void mouseExitBorder(JLabel icon) {
        icon.setBackground(Color.WHITE);
        lbStatus.setText("");
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel lbAmpulheta;
    private javax.swing.JLabel lbInvertido;
    private javax.swing.JLabel lbOval;
    private javax.swing.JLabel lbPera;
    private javax.swing.JLabel lbRetangulo;
    private javax.swing.JLabel lbStatus;
    // End of variables declaration//GEN-END:variables
}
